/**
 * 
 */
package com.googlecode.eventio.internal;

import java.util.concurrent.ExecutionException;

import com.googlecode.eventio.Reaction;
import com.googlecode.eventio.spi.FailureHandler;

/**
 * Failure handler that prints errors in {@link System#err}. Used as default
 * failure handler.
 * 
 * @author mofleury
 * 
 */
public final class StackTracePrintingFailureHandler implements FailureHandler {

	/**
	 * Report error on {@link System#err}
	 */
	@Override
	public <T> void handleFailure(Object event, T message, Reaction<T> reaction, Throwable t) {
		new ExecutionException("Unable to process event " + event + " with message " + message, t);
	}

}
